<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<TITLE></TITLE>
		<META NAME="GENERATOR" Content="Microsoft Visual Studio 7.0">
		<link rel="stylesheet" type="text/css" href="../Meta.css">
	</HEAD>
	<BODY>
		<H1>ArgumentTypeException</H1>
		<H2>What it means</H2>
		<P>This <A href="Exception.htm">exception</A> means that some part of the program 
			called a procedure with the wrong <A href="../type.htm">type</A> of value as an <A href="../arguments.htm">
				argument</A>.</P>
		<UL>
			<LI>
				The <FONT face="Arial">ParamName</FONT>
			field tells you which argument was wrong
			<LI>
				The <FONT face="Arial">valueProvided</FONT>
			field tells you what value the bad value was for the argument
			<LI>
				The <FONT face="Arial">expectedType</FONT> field tells you what type it <EM>should</EM>
				have been.</LI></UL>
		<H2>What causes it</H2>
		<P>Usually, argument type exceptions are due to:</P>
		<UL>
			<LI>
				Misunderstanding the requirements of the procedure being called</LI>
			<LI>
				Passing the arguments in the wrong order</LI>
			<LI>
				An error elsewhere in the program that causes it to compute the wrong type of 
				value in the first place</LI>
			<LI>
				Occasionally, it can happen because you pass the wrong kind of number to 
				something expecting a number.&nbsp; For example, if you use 1.0 as&nbsp;in 
				index into a list (indicies have to be integers, not floating-point numbers).</LI></UL>
		<H2>What to do</H2>
		<P>Check whether the value being passed to the procedure was a value you expected 
			to be passed in the first place.</P>
		<UL>
			<LI>
				If not, trace back through the code calling the procedure to find where the 
				rogue value originated</LI>
			<LI>
				If it was expected, check whether the ParamName is the right parameter 
				name.&nbsp; If not, you're passing the parameters in the wrong order.&nbsp; 
				Check the order of arguments again (the editor displays them automatically) and 
				rearrange them appropriately</LI>
			<LI>
				When all else fails, check the procedure's documentation to make sure you 
				understand its limitations</LI></UL>
	</BODY>
</HTML>
